-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
fix: Change login in field.setValue to use optional operator #12909
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While this prevents the crash, it doesn't solve the issue of the ref not being assigned correctly. Referencing this thread - https://consensys.slack.com/archives/C081B61CDS9/p1734459919055509?thread_ts=1734414724.387639&cid=C081B61CDS9, I suggested that we need to forward the ref to the TextInput so that the ref is propagated through. See implementation here - https://github.com/MetaMask/metamask-mobile/pull/12649/files#diff-b7bdacbc89185049ac31d9f4ede89235bf33402b7c5ea3977fc6328c11d51d06R22
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a comment
app/component-library/components/Form/TextField/foundation/Input/Input.tsx
Outdated
Show resolved
Hide resolved
app/component-library/components/Form/TextField/foundation/Input/Input.tsx
Outdated
Show resolved
Hide resolved
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you attach a video of current usage of the TextField/Input still being functional?
Done |
Please see this Slack thread for justification of removal of autoFocus for Login password input field |
|
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
Login view attempts to reset the password input field value but sometimes the ref for the input field is
null
. Therefore, I have turnedfieldRef.setValue
tofieldRef?.setValue
. Alternatively, since this occurs once successful navigation occurs and component is about to unmount, we may also be able to just remove the line.Related issues
Addresses this Sentry issue: https://metamask.sentry.io/share/issue/ef784f4e764a4a76bc505dcdaa52c0ec/
GitHub issue: #12653
Manual testing steps
null
in the code and login to the app. It should not trigger the catch clause right underneath it.Screenshots/Recordings
n/a but can producer if necessary
Before
n/a
After
login-setvalue.mov
Pre-merge author checklist
Pre-merge reviewer checklist